﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Transport
{
    public partial class _Default : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
           
        }

        protected string GenServiceIndex()
        {
            string html = null;
            DichVuControl dv = new DichVuControl();
            BangGiaTrongNgayControl bangGiaTN = new BangGiaTrongNgayControl();
            XeControl banggiaLT = new XeControl();
            List<dich_vu> list = dv.listAll();
            foreach (dich_vu dichVu in list)
            {
                html += "<div class=\"moduletable \"><div class=\"box-heading\">"
                    + "<div class=\"box-heading1\">" + dichVu.ten_dich_vu + "</div>"
                    + "<a href=\"/HireCars.aspx?madichvu="+dichVu.id_dich_vu+"\"><p class=\"box-heading2\">Xem tiếp >></p></a>"
                + "</div>";
                html +="<div class=\"moduletable_content\">"
                +"<div id=\"icecarousel140\" class=\"ice-carousel\">"
                        +"<div class=\"ice-main-wapper\">";
                if (dichVu.id_dich_vu == "0")
                {
                    List<BGTLTentity> bangGiaLTs = banggiaLT.listAllByRoute(0, 4);
                    foreach (BGTLTentity item in bangGiaLTs)
                    {
                        html += GenHtml.genBangGiaLT(item);
                    }
                }
                else
                {
                    List<BangGiaTrongNgayNew> banggias = bangGiaTN.GetBangGiaTrongNgayNew(dichVu.id_dich_vu, 0, 4);
                    foreach (BangGiaTrongNgayNew item in banggias)
                    {
                        html += GenHtml.getBangGiaNgay(item);
                    }
                }
                html += "</div></div></div></div>";
            }

            return html;
        }
    }
}
